import Request from "../core";
//项目内低代码接口

//页面列表
export const getPageList = (data) => {
  return Request.post(
    `/marketing/admin/lowCodePage/list?page=${data.page}&pageSize=${data.pageSize}`,
    data
  );
};
//页面新增
export const savePage = (data) => {
  return Request.post("/marketing/admin/lowCodePage/add", data);
};
//页面编辑
export const updatePage = (data) => {
  return Request.post("/marketing/admin/lowCodePage/update", data);
};
//模块新增
export const saveModule = (data) => {
  return Request.post("/marketing/admin/lowCodeModule/add", data);
};
//模块编辑
export const updateModule = (data) => {
  return Request.post("/marketing/admin/lowCodeModule/update", data);
};
//模块列表
export const getModuleList = (data) => {
  return Request.post(
    `/marketing/admin/lowCodeModule/list?page=${data.page}&pageSize=${data.pageSize}`,
    data
  );
};
//模块信息
export const getModuleById = (data) => {
  return Request.get("/marketing/lowCode/h5/getModuleById", data, {
    isLoading: false,
  });
};
//模块信息
export const updateStatus = (data) => {
  return Request.post("/marketing/admin/lowCodePage/updateStatus", data, {
    callbackOptions: {
      all: true, // 返回全部
    },
  });
};

/**
 * @method getWxaConfig
 * @description 获取小程序基础配置
 */
export function getWxaEntrance() {
  return Request.post(`/wx/biz/wxa/custom/getPubEntranceList?type=2&status=1`);
}

/**
 * @method getIndustry
 * @description 获取公域行业类型配置
 */
export function getIndustry() {
  return Request.get(`/business_admin/pubDomainBusiness/getIndustry`);
}

export function getBusinessDistrictList(data) {
  return Request.post(`/business_admin/pubDomainBusiness/list`, data);
}
